#ifndef __CoCImageNode_H__
#define __CoCImageNode_H__

class CoCImageNode;

class CoCImageNode : public Node
{
protected:
    GLuint      m_uVao;
    GLuint      m_uVbo;
    
    GLsizei         m_nBufferCount;
    V3F_C4B_T2F   *m_pBuffer;
    
    BlendFunc     m_sBlendFunc;
    
public:
	static CoCImageNode* create(int count, V3F_C4B_T2F* vertex, Texture2D *pTexture);
    virtual ~CoCImageNode();
    
    virtual bool initWithData(int count, V3F_C4B_T2F*, Texture2D *pTexture);
    virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags);
    void onDraw(const Mat4 &transform, uint32_t flags);
    
    virtual void setTexture(Texture2D *texture);
    virtual Texture2D* getTexture(void);
    BlendFunc getBlendFunc();
    virtual void setBlendFunc(BlendFunc blendFunc);
	virtual void updateBlendFunc(void);
    
    CoCImageNode();
	void setColor(Color4B color);
	Rect getRect();

private:
	Color4B        m_colors;
	Rect			m_Rect;
private:
    Texture2D *m_pobTexture;
    CustomCommand _customCommand;     ///
};

#endif // __CoCImageNode_H__
